package com.yf.service;

import com.yf.bean.CollectionBean;
import com.yf.bean.HistoryAnswer;

import java.util.List;
import java.util.Map;

public interface RedisService {
    List<String> getSubjectCateV2(String subject);
    List<String> getSubjectCateIds(String subject, String cate, int start, int count);
    int getSubjectCateLen(String subject, String cate);
    int genRegCode();
    boolean validateRegCode(String token);
    boolean containsRegCode(String token);
    String getRegCode();
    boolean addLoginSession(String key, String value);
    boolean checkLogStatus(String key, String value);
    boolean cacheUserInfo(String uid, String key, String value);
    String getUserInfo(String uid, String key);
    @Deprecated
    Map<String, String> getCategoryId(String cate);
    List<String> getRanking();
    Integer getQusTotalNum();
    boolean cacheUserInfoLong(Integer id, String key, String value);
    String getUserInfoLong(Integer id, String key);
    Map<String, Object> getSubjectQusInfo();

    @Deprecated
    List<String> getSubjectCate(String subject);
    @Deprecated
    String getSubjectAllQusID(String subject);
    String getSubjectAllQusIDv2(String subject);
    @Deprecated
    String getSubjectCateId(String subject, String cate);

    boolean addLike(Integer id, Integer count);
    boolean addDisLike(Integer id, Integer count);
    boolean incLike(Integer id);
    boolean incDisLike(Integer id);
    boolean decLike(Integer id);
    boolean decDislike(Integer id);
    Integer getLike(Integer id);
    Integer getDisLike(Integer id);
    boolean likeContains(Integer cid, Integer uid);
    boolean dislikeContains(Integer cid, Integer uid);
    boolean likeContainsAdd(Integer cid, Integer uid);
    boolean dislikeContainsAdd(Integer cid, Integer uid);
    Map<String, String> getUserHistoryAnswer(Integer uid, String prefix);
    Boolean setUserHistoryAnswer(Integer uid, List<HistoryAnswer> bean, String prefix, boolean init);

    Map<String, String> getUserCollection(Integer uid);
    Boolean setUserCollection(Integer uid, List<CollectionBean> bean, boolean init);

    String getKey(String key);
    boolean setKey(String key, String value, long expire);
    boolean existKey(String key);
}
